
<template>
  <div>
    <head-top></head-top>
    <div id="sector">

    </div>

  </div>
</template>

<script>
import headTop from '../../components/headTop.vue'
import echarts from 'echarts'
export default {
  name: 'sector',
  data() {
    return {
      option: {
        xAxis: {
          type: 'category',
          data: ['第一次考核', '第二次', '第三次', '第四次', '第五次', '第六次', '第七次']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [50, 40, 84, 68, 75, 97, 60],
            type: 'line'
          }
        ]
      }

    }
  },
  components: {
    headTop,
  },
  mounted() {
    let this_ = this;
    let chart = echarts.init(document.getElementById('sector'));
    chart.setOption(this.option);
    //建议加上以下这一行代码，不加的效果图如下（当浏览器窗口缩小的时候）。超过了div的界限（红色边框）
    window.addEventListener('resize', function () { chart.resize() });
  },
  methods: {},
  watch: {},
  created() {
  }
}
</script>
<style scoped>
#sector {
  width: 100%;
  height: 600px;
  margin: 20px auto;
}

canvas {
  position: absolute;
  top: 40px;
  height: 800px
}
</style>



